package com.client.common.util;


import com.client.model.pojo.user.ArUser;

/**
 * @Author：刘文举
 * @DateTime： 2024/3/27 16:13
 * @PackageName: com.zt.utils
 * @ClassName: AuthContextUtil
 */
public class AuthContextUtil {

    //线程要和用户信息绑定
    private static final ThreadLocal<ArUser> theadLocal = new ThreadLocal<>();

    //绑定用户信息
    public static void setUser(ArUser arUser) {
        theadLocal.set(arUser);
    }

    //获取用户信息
    public static ArUser getUser() {
        return theadLocal.get();
    }

    //清除用户信息
    public static void clear() {
        theadLocal.remove();
    }
}
